<template>
	<!-- 活动列表 -->
	<view class="active-register">
		<view class="header"><uniNavBar leftImg="/static/h5img/return_black@2x.png" @clickLeft="clickLeft" title="活动列表"></uniNavBar></view>
		<view class="active-content">
			<view v-for="(item, i) in activeData" :key="`active-${i}`" class="active-item" @tap="seeDetails(item)">
				<view class="active-img-view">
					<image src="" class="active-img"></image>
					<view class="img-mask">未开始</view>
				</view>
				<view class="active-details">
					<text class="active-title">熊猫出没618大将团建补贴会熊猫出没618大将团建补贴会熊猫出没618大将团建补贴会熊猫出没618大将团建补贴会</text>
					<text class="active-time">报名时间：2019-03-21 14:11:11</text>
					<text class="active-address">河南郑州河南郑州河南郑州河南郑州河南郑州河南郑州河南郑州河南郑州</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue';
import { ifLogin } from '@/common/js/index'
export default {
	data() {
		return {
			// 活动数据
			activeData: [1, 2, 5]
		};
	},
	methods: {
		// 返回前页面
		clickLeft() {
			uni.navigateBack();
		},
		// 点击跳转活动详情
		seeDetails(data) {
			console.log(data,'data')
			uni.navigateTo({
				url: '/pages/activeDetails/activeDetails'
			})
		}
	},
	components: {
		uniNavBar
	},
	onLoad() {
		const status = ifLogin()
	}
};
</script>

<style scoped lang="scss">
body,
uni-page-body {
	background-color: #f7f7f7;
}
.active-register {
	.active-content {
		padding: 0 30rpx;
		.active-item {
			margin: 20rpx 0;
			background-color: #fff;
			border-radius: 12rpx;
			box-shadow: 0rpx 2rpx 8rpx 0rpx #999;
			padding: 28rpx;
			display: flex;
			.active-img-view {
				height: 172rpx;
				width: 172rpx;
				position: relative;
			}
			.active-img {
				height: 172rpx;
				width: 172rpx;
				background-color: #8a6da9;
				border-radius: 4rpx;
			}
			.img-mask {
				width: 172rpx;
				height: 172rpx;
				background-color: rgba(0, 0, 0, 0.5);
				position: absolute;
				top: 0;
				color: #fff;
				text-align: center;
				line-height: 172rpx;
				font-size: 32rpx;
				font-family: PingFang SC;
				font-weight: 500;
			}
			.active-details {
				margin-left: 26rpx;
				flex: 1;
				font-family: PingFang SC;
				font-weight: 500;
				.active-title {
					line-height: 36rpx;
					font-size: 26rpx;
					text-overflow: -o-ellipsis-lastline;
					word-break: break-all;
					overflow: hidden;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-line-clamp: 2;
					-webkit-box-orient: vertical;
					line-clamp: 2;
					color: #333;
				}
				.active-time {
					font-size: 22rpx;
					color: #999;
					line-height: 26rpx;
					margin-top: 26rpx;
					display: block;
					height: 26rpx;
				}
				.active-address {
					margin-top: 22rpx;
					font-size: 22rpx;
					color: #999;
					line-height: 26rpx;
					display: block;
					word-break: break-all;
					overflow: hidden;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-line-clamp: 1;
					-webkit-box-orient: vertical;
				}
			}
		}
	}
}
</style>
